package com.vctgo.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.vctgo.system.mapper.TProfessionMapper;
import com.vctgo.system.domain.TProfession;
import com.vctgo.system.service.ITProfessionService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vctgo.common.core.text.Convert;
import com.vctgo.common.core.utils.ServletUtils;
import com.vctgo.common.mybatisplus.constant.MybatisPageConstants;
/**
 * 行业Service业务层处理
 *
 * @author vctgo
 * @date 2024-12-17
 */
@Service
public class TProfessionServiceImpl implements ITProfessionService
{
    @Autowired
    private TProfessionMapper tProfessionMapper;

    /**
     * 查询行业
     *
     * @param id 行业主键
     * @return 行业
     */
    @Override
    public TProfession selectTProfessionById(Long id)
    {
        return tProfessionMapper.selectById(id);
    }

    /**
     * 查询行业列表-分页
     *
     * @param tProfession 行业
     * @return 行业
     */
    @Override
    public IPage<TProfession> selectTProfessionPage(TProfession tProfession)
    {
        Page mpPage =new Page(Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_NUM),1L)
                ,Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_SIZE),10L));
        return tProfessionMapper.selectTProfessionList(mpPage,tProfession);
    }
    /**
     * 查询行业列表
     *
     * @param tProfession 行业
     * @return 行业
     */
    @Override
    public List<TProfession> selectTProfessionList(TProfession tProfession)
    {
        return tProfessionMapper.selectTProfessionList(tProfession);
    }

    /**
     * 新增行业
     *
     * @param tProfession 行业
     * @return 结果
     */

    @Override
    public int insertTProfession(TProfession tProfession)
    {
        return tProfessionMapper.insert(tProfession);
    }

    /**
     * 修改行业
     *
     * @param tProfession 行业
     * @return 结果
     */
    @Override
    public int updateTProfession(TProfession tProfession)
    {
        return tProfessionMapper.updateById(tProfession);
    }

    /**
     * 批量删除行业
     *
     * @param ids 需要删除的行业主键
     * @return 结果
     */
    @Override
    public int deleteTProfessionByIds(Long[] ids)
    {
        return tProfessionMapper.deleteTProfessionByIds(ids);
    }

    /**
     * 删除行业信息
     *
     * @param id 行业主键
     * @return 结果
     */
    @Override
    public int deleteTProfessionById(Long id)
    {
        return tProfessionMapper.deleteById(id);
    }
}
